package com.dingdang.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000118651677";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCaBRezZ9qx/0aNvjTVOtgLEtYVOl4dBiDu6v9I/5Ukv15Hv3Em66c725ecHnaxUbN5uNhfXVdjO1b9nWADyuNLZi8ENHKJRgqIDdHkhzDQRRa87c6tfO9ZiU/Qkce/yJYNbxn3rbIT7rUqqdD8OPaHC4+PLX1d3O51nNFgyOgnZs8E4X4J4XH1bT7KkMZqcFRSJoG/8HftVv5iP5CUqG00fv1yrremXyq0WHT27u8mMtmR4SCyqsOj5i3URcuoPCAdwC0ksVrSPraq4gkpPU9hHH2F9E1pcb35XNEy0A/CJVCKEOuHujZNb8GhNyVVT12b0gGy87QWaUfqjXDEHocjAgMBAAECggEAUuCEpVwv+PHVRDZidY7JbAQBwMB8nf+LPySio+Qrm++Byve/6mKJxZLfHPnjgnzlJ42ImKBAgrwOjj/dx4yoDA17JTcXnrhauGU/WUpJwPg8SQNp4D7HCJXzpdab9p336FitT3JezYz4XXGta9s3BOn6oN+ogxZ8FjuBCyRwj6pTNfIRN5U/RACg6VATy9Z5zcptJ+XqoFbEP5Mgzsbu/dxaI8l2YwkCXQc/4L9Mvu/UFW1LlbqETSl++RqT9TB2X0UhBSTMLtwI6NDAtmgCYwzACF9wgxwwgRszfoWY+WW5W89AqNyRbV1ESyH/unq448IIuPiWUJt746NS67I5KQKBgQDXjveWlPukOJC8ikZnR+r0voM1d3K3PKYrjEndhP9b24GkTJiyVEggFMBYagy7w5VS342XYsd2KtECdwu4orbuvJmoVqW5Oe3uA31BVCHaUhWeK2PdDXWU4/+XFmd6JGHLIvmkzjDJV1B9Uqxx7gIXTc87JEUmFcdcPNagpaHiDQKBgQC26n8TI3WPpZ4m3we68bFcNNnq4eqd8B6stRReCI4wLBS7Arxq7twFM09HiGVjOs0RO0y6H6JrKJ8wnZWBSPxBl2y+S/WvFdW9bptALwBfzY+wNflLG5UcJSt7VKroxZcwsJZNwhnmCGr4MnmimD+JjTYHu0QwZGCGaP7uJpgx7wKBgCA64SwjtIh2aLW4GxTAPRJBFg89f+qD5/ik7jpv81qBtJ2jUkV/spURZT0TBjpg4QfWIy6ad2ZkuoGa2SbPNXj2vCbeZcMPNVMcNHM7KCCjm1Xd+P2JUKZlfMbTc79ghzq/TQJmTgccxg0m+l/CjY98c9rM7oXmRbu14QV+HnlVAoGAMvNIqD0VTwjz76HqVlFidOun07xQDORItxTNco/xg0uUDq9pamPUV4J+T8+XZjeHzYf2DFYpeK3dAb6zWUrKMT8LpEomSjnLyrNXfV5aPVVV8+Bk613of+l+niDsZmA7h+14QHqTmja4DSCKLxc3g4oZBbhM+ynKlUYD1LRdanMCgYBVXrOPkZG9KVF/P3gssucE38ckdMCSen7c24eeBv6uUpbmENWlKJikQojbM2HZKnZY6c885jyEqDBDqIRlFFIMzMS03OT2rENdSbWckKeMeHCSBMcGGrw555NAM29wvgJZDGWBvn+XtAIiETktP4dDu40gvQe7YFotAtifTuq9oQ==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmsbywwTdkZdOWi4zX6nJMrWUZ7mK3BtL/hT3zVEsHfMOiWgPOMlTZkYCyMmTpAu/FnK5TfwUcyjt6ppId403iKZF2nXeUsPHVmxZTGJi/cp+wCVKURX1gyMqzDeRCtyzWvSRWtrZU6gRPnRukiXhvOxJEaejK2p39n2sXpfIRLmx+FvkpnjUwm+BQK/fPDWs4k+8cCCRUBbtbsQkj8zDl6+8ADJVKPPzu/5wFu3KbrRcdL/DbIN8nNr6B1afQm4q9wMggz1TRMOKueNbwpXVekkgRkURytlWFYrEWBZiPZ7YewbDuolxrGnCBb7tWd4/2LDJ0vJS/iq2JQIlWRbznwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://4t5a649347.51vip.biz/advertise/notifyUrl";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://4t5a649347.51vip.biz/advertise/returnUrl";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "D:\\logs\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}